package com.example.yogurtsystem.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.yogurtsystem.common.PageResult;

/**
 * @ClassName PageUtil
 * @Description TODO
 * @Author ZXB
 * @Date 2020/12/2 11:35
 * @Version 1.0
 */
public class PageUtil {

    public static PageResult pageResultCopy(IPage iPage){
        PageResult pageResult=new PageResult();
        pageResult.setPageCurrent(iPage.getCurrent());
        pageResult.setPagePages(iPage.getPages());
        pageResult.setPageSize(iPage.getSize());
        pageResult.setPageTotal(iPage.getTotal());
        pageResult.setData(iPage.getRecords());
        return pageResult;
    }

}
